package com.ps.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.ps.dao.IOrderDao;
import com.ps.service.IOrderService;
import com.ps.vo.Order;
import com.ps.vo.PageUtil;

public class OrderService implements IOrderService {

	@Autowired
	IOrderDao orderDao;
	
	@Override
	public PageUtil<Order> queryOrderList(PageUtil<Order> pageUtil) {
		Map<String,Object> map=new HashMap<>();
		map.put("start", pageUtil.getStart());
		map.put("size", pageUtil.getPageSize());
		
		List<Order> list=orderDao.queryOrderList(map);
		int total=orderDao.queryOrderTotal();
		
		pageUtil.setRows(list);
		pageUtil.setTotal(total);
		return pageUtil;
	}

}
